home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_lockerdoor.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  166 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_LockerDoor.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     activated
  14.  
  15.     thing       player      local
  16.     thing       indy        local
  17.     thing       t_Item      local
  18.     
  19.     thing       door
  20.     thing       offsetCam
  21.     thing       ghost_Thing
  22.     thing       cam1
  23.     thing       camTarg
  24.     thing       ghostPos        # move player to this pos
  25.     thing       walk_Targ       # walk indy to this pos
  26.     
  27.     template    tpl_Thing
  28.     template    tpl_Actor=indy_actor        local
  29.     
  30.     sound       snd_Open=fol_lockr_opn.wav        local
  31.     sound       snd_Close=fol_lockr_cls.wav       local
  32.     
  33.     sound       snd_Raft=Rv02j01.wav        local # a raft... so this is..
  34.     sound       snd_Patch=inxj241.wav       local # a raft repair kit
  35.     sound       snd_Health=Inxj155.wav      local # a medical kit
  36.     
  37.     cog         talkCog     local
  38.     
  39.     flex        openDoor    local
  40.     
  41.     int         open=0      local
  42.     int         playing=0   local
  43.     int         bin_Num     local
  44.  
  45. end
  46.  
  47. # ========================================================================================
  48.  
  49. code
  50.  
  51. startup:
  52.  
  53.     player = GetLocalPlayerThing();
  54.     SetThingLight(door, '0.25 0.25 0.25', 0.1, 0.5);
  55.     return;
  56.     
  57. # ========================================================================================
  58.  
  59. activated:
  60.  
  61.     if((GetSenderRef() == door) && (open == 0) && (playing == 0))
  62.     {
  63.         Call openDoor;
  64.     }
  65.     
  66.     return;
  67.     
  68. # ========================================================================================
  69.  
  70. openDoor:
  71.  
  72.     # do cutscene stuff
  73.     MakeMeStop();
  74.     StartCutscene(0);
  75.     
  76.     # put away any weapon
  77.     DeselectWeaponWait(player);
  78.     
  79.     # nudge door
  80.     PlayMode(player, 60, 0);
  81.     Sleep(0.3);
  82.     
  83.     # create item
  84.     t_Item = CreateThing(tpl_Thing, ghost_Thing);
  85.     CaptureThing(t_Item);
  86.     bin_Num = GetCurItem(t_Item);
  87.     
  88.     Sleep(0.5);
  89.     
  90.     # switch to camera inside locker
  91.     SetCameraFocus(2, cam1);
  92.     SetCameraSecondaryFocus(2, camTarg);
  93.     SetCurrentCamera(2);
  94.     
  95.     # move player away from door
  96.     CopyOrientAndPos(ghostPos, player);
  97.     
  98.     # create indy actor
  99.     indy = CreateThing(tpl_Actor, player);
  100.     CaptureThing(indy);
  101.     
  102.     # outfit indy actor
  103.     CopyPlayerHolsters(player, indy);
  104.     
  105.     # hide player show indy
  106.     SetThingFlags(player, 0x80000);
  107.     ClearThingFlags(indy, 0x80000);
  108.     
  109.     Sleep(0.5);
  110.     
  111.     PlaySoundLocal(snd_Open, 1.0, 0.0, 0x0, 0);
  112.     Rotate(door, -90, 1, 1.0);
  113.     WaitForStop(door);
  114.     
  115.     Sleep(0.5);
  116.     
  117.     # indy walks up to locker
  118.     AISetCutsceneMode(indy);
  119.     AISetMoveSpeed(indy, 1.0);
  120.     AISetLookThing(indy, walk_Targ);
  121.     AISetMoveThing(indy, walk_Targ, 1);
  122.  
  123.     # RT: Swap player back in so lips move...
  124.     CopyOrientAndPos(indy, player);
  125.     SetThingFlags(indy, 0x80000);
  126.     ClearThingFlags(player, 0x80000);
  127.     
  128.     # reach for the item
  129.     PlayMode(player, 60, 0);
  130.     Sleep(0.3);
  131.     DestroyThing(t_Item);
  132.     
  133.     # Call the Pickup Lines cog
  134.     talkCog = GetCogByIndex(0);
  135.     SendMessage(talkCog, 27);
  136.     
  137.     # sleep to wait for talkCog
  138.     Sleep(1.3);
  139.     
  140.     # add item to inventory
  141.     SetInvAvailable(player, bin_Num, 1);
  142.     ChangeInv(player, bin_Num, 1.0);
  143.     JonesInvItemChanged(bin_Num);
  144.         
  145.     # Johnny, tell the player what he's picked up
  146.     if(bin_Num == 48) PlayVoice(player, snd_Health, 1.0, 1);
  147.     if(bin_Num == 56) PlayVoice(player, snd_Patch, 1.0, 1);
  148.     if(bin_Num == 57) PlayVoice(player, snd_Raft, 1.0, 1);
  149.     
  150.     # restore camera
  151.     SetCameraPosition(1, GetThingPos(offsetCam));
  152.     SetCurrentCamera(1);
  153.     
  154.     # return control to player
  155.     ClearActorFlags(player, 0x200000);
  156.     EndCutscene();
  157.     
  158.     playing = 0;
  159.     open = 1;
  160.     
  161.     return;
  162.     
  163. # ========================================================================================
  164.  
  165. end
  166.